<?PHP
date_default_timezone_set("Asia/Chongqing");
include("../public/common.php");
include("taobaosdk/TopSdk.php");

$itemid = CheckUrlParamNoDie("itemid");
if ($itemid != "")
{
	$c = new TopClient;
	$c->appkey = "12175045";
	$c->secretKey = "fecb88ed680dc756af6fef24cc62b27f";
	$req = new ItemGetRequest;
	$req->setFields("detail_url,title,nick,cid,pic_url,num,price,prop_img");
	$req->setNumIid($itemid);
	$resp = $c->execute($req);
	
	if ($resp->getName() == "item_get_response")
	{
		$str = "{\"code\":1";
		$str .= ",\"detail_url\":\"".$resp->item[0]->detail_url."\"";
		$str .= ", \"pic_url\":\"".$resp->item[0]->pic_url."\"";
		$str .= ", \"title\":\"".$resp->item[0]->title."\"";
		$str .= "}";
		echo $str;
		exit;
	}
}

echo "{\"code\":0}";
exit;
?>